namespace TouchSmart.Animations
{
    public class AnimationMetadata
    {
        public int LastTick { get; set; }
        public Animation Animation { get; set; }

        public bool IsAnimationCompleted
        {
            get { return Animation.IsCompleted; }
        }

        public AnimationMetadata(int lastTick, Animation animation)
        {
            LastTick = lastTick;
            Animation = animation;
        }

        public void Animate(int tick, int interval)
        {
            var delta = (tick - LastTick) / interval;
            LastTick = tick;
            Animation.Animate(delta);
        }
    }
}